# PMG Platform
The PMG Platform actions provide various activities related to PMG Platform specific features, such as Service creation, encryption, order and request management, and more.
# Add Comment
Action Function: This will add a comment to the comments widget via workflow. At this time, comments without attachments are supported, but support for attachments is planned for a future release.
Action Outputs: The Add Comment action returns the following values:
Success – The action executed successfully
Failure – An issue was encountered
Action Properties:
Label
A label for the activity
Properties
Comment
The body of the comment.
Entity Id
The Id of the entity being commented on. For example, Order Number, Request Id or Knowledge Id.
Entity Type
The type of entity being commented on. The following are the Built In Entity Types:
0: Document
1: Content Block
2: Product
3: Page
4: Link
5: Workflow
6: Article
7: Topic
Alternately, -1 can be used to define Global Comments.
For custom entity types, please refer to the CustomEntityTypes table in PMGSC.
User Id
User Principal Name of the source of the comment.
Variable For Storing Error Message
Variable to store the error message (if any).
Variable For Storing New Comment Id
Variable to store the id of the new comment.
# AdHoc Forms
Action Function: The Adhoc forms action allows one or more users to interact with submitted form data during the workflow lifecycles, however it's not a work item, or task, as provided by human actions.
Action Outputs: The action supports custom outputs, so based on the end user interaction with the Adhoc Forms activity the workflow can perform needed tasks. In addition to the custom outputs created when configuring this action, each Adhoc forms action can return the following possible output values as well:
- Error – An issue was encountered
Action Properties:
Label
A label for the activity
Properties
Actor(s)
This property is used to specify the users (s) who will be assigned to this AdHoc Forms activity.
Any Person
This property is used to specify if any user with the link can view the work item (True), or only the user(s) specified in the actor(s) property (False).
Key
This property specifies the Key value to match for corresponding Wait for Message actions that are waiting. The Key can be set as a static value, or can be generated dynamically using existing Variable, Content, and/or XML Variable data.
Response Output
This property defines the output that should be followed by the matching Wait for Message activities. The output can be set as a static value, or can be generated dynamically using existing Variable, Content, and/or XML Variable data.
Work Item Form Configuration
This setting allows for overriding the default form behavior for the work item. See Work Item Form Configuration for usage instructions.
Expiration Time
A specified time, after which the response output options are no longer valid.
Expiration Offset
# Assign from Queue
Action Function: The Assign from Queue action provides for assigning work to a particular user from a given queue.
Action Outputs: The Assign from Queue activity returns the following values:
Success – the work was assigned
Failure – there was an issue assigning the work
Action Properties:
Label
A label for the activity
Properties
Human Action Name
The action ID in the workflow diagram to be used for the assignment
Assign To User
The User ID to assign the work
Queue
The name of the queue from which to take the work
Error Variable
A variable to hold any error information from the assignment task
Any Person
# Cancel Milestone
Action Function: The Cancel Milestone action is used to define the point in which a request has been cancelled and no further workflow milestones will be met.
Action Outputs: The Cancel Milestone action returns no output values.
Action Properties:
Label
A label for the activity
Properties
Comment
This property specifies the cancel comments. Based on milestone widget configuration, they may or may not be displayed with the milestone widget.
# Complete Milestone
Action Function: The Complete Milestone action is used to define the point in which a workflow milestone is met. Milestones can be progressed in sub workflows called by a parent workflow. To progress milestones in a called workflow, define the needed milestone values in the start step milestone property for at least the milestones to be used by this action in the called workflow.
Action Outputs: The Complete Milestone action returns no output values.
Action Properties:
Label
A label for the activity
Properties
Select Milestone
This property specifies the milestone met. The milestones of a workflow are defined on the Start Step.
# Create Service
Action Function: The Create Service action will generate a service in a target environment.
Action Outputs: The action has the following outputs
Failure – An issue was encountered in creating the service
Success – The item was created successfully
Action Properties:
Label
A label for the activity
Properties
Scenario(required)
This property specifies the connection details for the target environment. The setting is the name of the scenario which has been defined in the ServiceBuild.Config.xml scenario.
Example ServiceBuild.Config.xml
<config>
<!-- NAME MUST BE IN UPPERCASE -->
<!-- PASSWORD MUST BE ENCRYPTED -->
<scenario name="SPEWSACCOUNT" irequestserver="localhost:8080" spewsuserlogon="userid@pmgnet.dev"
spewsuserencryptedpassword="VgCGEB" default="true" usessl="”false”"></scenario>
</config>
Service Id(required)
This property defines the Service ID to be created
Service Name (required)
Specifies the Service Name to be created
Service Description (required)
The description for the new service
Service Categories
A comma separated list of service category IDs.
Service Workflow
Specifies the workflow ID for the new service
Service Image
A file path and file name for the service image
Service Form Elements
An XML document defining the service form elements. This property is ignored if any “Service Shared Forms” are specified.
This property is in XML encoded format, typically using a service export document as a baseline for creation.
The below is an encoded example which will create a hidden text field, “IAmHidden” set to a default value of ‘1’.
<form_elements>
<form_element index="0" required="0" tooltip="0" tooltiptext="" hidden="0" type="text" adv_copy_target="" adv_invisible="1" adv_section_head_init_open="1">
<display_name>IAmHidden</display_name>
<display_name_full>IAmHidden</display_name_full>
<default_value>1</default_value>
<validation_code/>
<max_file_count/>
<max_file_size/>
<file_ext_allowed/>
<enable_rte>false</enable_rte>
<date_validation_code/>
<date_validation_code_max/>
<date_validation_code_wkdays/>
<date_restrict_text/>
<cmconfigdata/>
<validation_fail_msg/>
<date_validation_fail_msg/>
<price_mod frequency="singular"/>
</form_element>
<question_relation_xml><qs/></question_relation_xml>
<calcucode/>
<dynamic_relation_code/>
</form_elements>
It may be easier to work with this document in decoded format. The above would be decoded as below.
<form_elements>
<form_element index="0" required="0" tooltip="0" tooltiptext="" hidden="0" type="text" adv_copy_target="" adv_invisible="1" adv_section_head_init_open="1">
<display_name>IAmHidden</display_name>
<display_name_full>IAmHidden</display_name_full>
<default_value>1</default_value>
<validation_code></validation_code>
<max_file_count></max_file_count>
<max_file_size></max_file_size>
<file_ext_allowed></file_ext_allowed>
<enable_rte>false</enable_rte>
<date_validation_code></date_validation_code>
<date_validation_code_max></date_validation_code_max>
<date_validation_code_wkdays></date_validation_code_wkdays>
<date_restrict_text></date_restrict_text>
<cmconfigdata></cmconfigdata>
<validation_fail_msg></validation_fail_msg>
<date_validation_fail_msg></date_validation_fail_msg>
<price_mod frequency="singular"></price_mod>
</form_element>
<question_relation_xml>
<qs></qs>
</question_relation_xml>
<calcucode></calcucode>
<dynamic_relation_code></dynamic_relation_code>
</form_elements>
Service Shared Form
A comma, “,” separated list of shared form IDs to attach to the service. If any shared forms are specified, then the “Service Form Elements” property is ignored.
Service Keywords
A comma separated list of search terms for the service
Base Price
The base price for the service
Ongoing Price
The recurring price for the service
Service Permissions
A comma separated list of permissions for the service
Show Pricing
Controls the pricing display for the service. Options are “True” and “False”
Order Type
Defines the order behavior options for the service. Options are “Standard” and “Instant”
# Create Service from XML
Action Function: The Create Service action will generate a service in a target environment using a Service Import XML document.
Action Outputs: The action has the following outputs
Failure – An issue was encountered in creating the service
Success – The item was created successfully
Action Properties:
Label
A label for the activity
Properties
Scenario(required)
This property specifies the connection details for the target environment. The setting is the name of the scenario which has been defined in the ServiceBuild.Config.xml scenario.
Example ServiceBuild.Config.xml
<config>
<!-- NAME MUST BE IN UPPERCASE -->
<!-- PASSWORD MUST BE ENCRYPTED -->
<scenario name="SPEWSACCOUNT" irequestserver="localhost:8080" spewsuserlogon="userid@pmgnet.dev"
spewsuserencryptedpassword="VgCGEB" default="true" usessl="”false”"></scenario>
</config>
Service XML(required)
The XML document based on a service import/export format
# Decrypt String
Action Function: The Decrypt String action will decrypt form fields which are marked as encrypted. See the DynaForm encrypted field options for more details.
Action Outputs: The action has the following outputs
Failure – An issue was encountered in decrypting the string
Success – The string was decrypted without issue
Action Properties:
Label
A label for the activity
Properties
Ciphertext (required)
The encrypted value to be decrypted.
Plaintext Variable(required)
The string variable to store the decrypted value.
# Follow Output
Action function: The Follow Output action will follow a specified action instance output
Label
A label for the action in the diagram
Properties
Action Step Id
The step id of an action execution instance to follow out the specified path. The step ID is the unique ID of the executed action instance in the diagram.
Output
The output to follow
Complete Action
Determines if the specified action instance will be completed or sleeping after the output is followed.
Error Variable
Variable to store related errors.
# Get Review Order Details
Action Function: The Decrypt String action will decrypt form fields which are marked as encrypted. See the DynaForm encrypted field options for more details.
Action Outputs: The action has the following outputs
Failure – An issue was encountered in decrypting the string
Success – The string was decrypted without issue
Action Properties:
Label
A label for the activity
Properties
BasketId (required)
The internal basket ID
Variable for order details XML
A string variable to store the order details XML
XML Variable for order details XML
An XML variable to store the order details XML
# List Edit
The List Edit Action will create or delete Lists. Properties for the action are below.
Action Outputs: The action has the following outputs
Error – An issue was encountered in the action
Success – The action ran without issue
Action Properties:
Label
A label for the activity
Properties
List Name
The internal name or identifier for the list
List Display Name
The display name for the list
Action
The action to take with the list. Options are “Create/Edit” which will create a new list if one does not exist, or simply continue, and “Delete” which will delete the list.
# List Item Edit
The List Item Edit Action will manage entries for a list. Properties for the action are below.
Action Outputs: The action has the following outputs
Error – An issue was encountered in the action
Success – The action ran without issue
Action Properties:
Label
A label for the activity
Properties
List Name
The internal name or identifier for the list
Value
The value of the entry to be managed
Label
The display text for the entry
Location
The target location for the new entry, if added. Options are “Top”, “Bottom”, “Sorted on Label”, and “Sorted on Value”
Action
The action to take for the entry. Options are “Create/Edit”, and “Remove”
# List Item Query
The List Item Query Action will read a list into a target variable. Properties for the action are below.
Action Outputs: The action has the following outputs
Failure – An issue was encountered in the action
Success – The action ran without issue
Action Properties:
Label
A label for the activity
Properties
List Name
The internal name or identifier for the list
Sort By
The property to use to sort the returned list. Options are “Index” (As defined), “Value”, and “Label”
Label
The display text for the entry
Location
The target location for the new entry, if added. Options are “Top”, “Bottom”, “Sorted on Label”, and “Sorted on Value”
Results Variable
The target variable, to be saved as a JSON string in Array format
# Manage Queue Users
The Manage Queue Users Action adds or removes users from a named queue. Properties for the action are below.
Action Outputs: The action has the following outputs
Failure – An issue was encountered in the action
Success – The action ran without issue
Action Properties:
Label
A label for the activity
Properties
User UPN
The UPN of the user to add or remove from the queue.
Queue
The queue ID or name from which to add or remove the user.
Add Or Remove
The action to perform. Select "add" to add the user to the queue. Select "remove" to remove the user from the queue.
Error Variable
The error target variable. This variable will store the error message should an error occur.
# Order A Service
Action Function: The Order A Service activity allows a workflow to submit an order on behalf of a user.
Action Outputs: The Order A Service Status activity can output the following values:
Failure – returned if the order was not successfully submitted
Success – returned if the order was successfully submitted for fulfillment
Action Properties:
Label
A label for the activity
Properties
User Id (logon)
This property is used to identify the existing system user for whom the order (or request) should be submitted. The entry in this field should reflect the Logon (or User Principal Name) for the target user.
NOTE: If applicable, this property field may be left blank to submit the request on behalf of the user from the current workflow process.
Service Id (required)
This property is used to specify the service to be ordered on behalf of the user specified in the previous field. The entry in this field is intended to reflect the unique Service ID for the selected service, as seen in the front-end interface when a service is open in Edit Mode. The service specified in this field will drive the questions presented in the subsequent Service Question Value Config property.
Service Question Value Config (optional)
This property is used to populate values for the applicable request form questions when submitting the selected service on behalf of another user. This property requires the preceding Service ID property to be set with a valid Service ID to pull the set of applicable form questions for that service to be configured. At a minimum, any applicable questions from the selected service form that are required must be assigned values via this property.
Steps to set the Service Question Configuration:
Click “Click to Add” or “Click to Edit” for the property.
The new property window will display all the available form questions for the specified Service ID to be ordered. For each question listed in the SPE Mapping Name column on the left, values may be defined in the respective Value input box.
Either enter static values directly into the corresponding Value fields for each question as needed, or use the type-ahead feature to access workflow values (using CTRL-Space shortcut)
Once all the applicable questions have been assigned appropriate values, click Save, or “Save and Close” to save the value settings and close the property window
Use this Requests Data
Option to copy forward the current workflow’s Request Data into the new request. Options are No, and Yes.
Variable For Request Id (optional)
This property is used to specify an existing variable (of type ‘string’) to be used for storing the request number generated when the order is submitted, if applicable.
# Register Login Link Code
Action function: The Register Login Link Code action is used to associate a new or existing code to an existing user by login. When a code is associated to a user, a link that contains the URL parameter loginLink=CODE, can be used to log the user in.
Label
A label for the action in the diagram
Properties
User Id
The User Id (logon) to associate to this code.
Existing Code
Optional way to specify an existing or pre-generated code.
Code
Location to store the new code.
# Re-execute Action
Action function: Re-execute Action is used to re-execute an action, by action id.
Labels
A label for the action in the diagram
Properties
Action Step Id
The step id of the action to re-execute. The step ID is the unique ID of the executed action instance in the diagram.
# Review Order
Action Function: The Review Order activity can be used within a “Review” workflow to submit applicable orders to a review process for modification and approval before the request is committed as a fully completed order. The Review Order action will route a draft service request to a specific user (or set of users) for review and approval. During the review process, the assigned user(s) can validate the submitted order, and possibly even edit it, before allowing the order to proceed. NOTE: This activity should only be used within a Review type workflow design.
Sample Scenario: While approvals and/or even edits to fully committed orders can also be handled within a standard System type workflow design, the Review workflow type provides another option for modifying and approving an order before fully committing it to the service process engine for fulfillment. For orders where the end-user may not have all the necessary information, or orders that initiate automated sub-processes when fully submitted, or where the details might be subject to change before being fully committed, the Review Order activity enables the request to be routed in draft form to the specified approver(s) or editor(s) in advance.
For example, in the case of an order for a new server, the request may first go to an engineering team for review and validation, then to security, and finally back to the original requestor, before being committed as a finalized order.
Action Outputs: In addition to any custom values defined in the Options property, the Review Order activity returns the following output values:
- Not Enough Resources – output when the filter condition defined in the Actor Recipient property does not return at least one valid resource
Action Properties
Label
A label for the activity
Properties
Actor Recipient
This property is used to specify the actor(s) who will be assigned to this Review Order activity.
Notes
This optional property can be used to provide additional notes or comments for the selected reviewer(s).
Can Edit
This Yes/No property, set to “Yes” by default, specifies whether the selected Actor Recipient(s) assigned to the Review Order task can edit the order while reviewing it.
Send Notify Email
This Yes/No property, set to “No” by default, specifies whether the selected Actor Recipient(s) for this Review Order task should be sent an email notification upon being assigned.
Notify Email Subject
This property defines the subject line for the notification Email
Options (required)
This property is used to specify the possible outputs for this action. The outputs defined in this property will appear as choices for the Actor Recipient(s) assigned to this Review Order activity (e.g., Submit Order, Return Order to Submitter, Cancel Order, etc.). For each output defined here, the workflow design would need to reflect an output path to follow.
To set this property, select “click to add” or “click to edit” for the property.
In the displayed window, click “Add” to add as many rows as desired. For each row, provide the following.
Output – specifies the display name for the output option
Completion Maker? – Yes/No drop-down menu designates whether this output option should serve as a completion-maker for this Review Order activity. If set to “Yes,” this step will be marked as completed and left behind in the workflow when the applicable output option is selected by the Actor Recipient(s); otherwise, if set to “No,” the activity will continue to process even after this option is selected.
Once all applicable Outputs have been defined, select Save or “Save and Close” to save the settings and close the property window.
# Save Signature Image
Action Function: The Save Signature Image action will store vector signed image data, as PNG format, from the Signature form element into a file variable. NOTE: The signature form element registered using "Custom Form Elements", using configModulesBuiltIn\Signature.aspx
Action Outputs: The Submit Order activity returns the following output values:
- Success – The action ran without error
- Failure – There was some error encountered running the action
Action Properties:
Label
A label for the activity
Mapping Name - the form field mapping name using the Signature Form Element
File Name - A name to give the stored file in the file variable
Image Variable - the target file variable to store the signature image file
Error Variable - an optional variable to store any error messages encountered in the action processing
# Set Alternate Request ID
Action Function: The Set Alternate Request ID activity sets an override value for the current workflow’s related request number.
Action Outputs: The Submit Order activity returns the following output values:
[blank] – Followed when the request ID is set successfully
Error – Followed if there was an error setting the request ID
Action Properties:
Label
A label for the activity
Properties
Request Id
A new override value for the request ID
# Set SubmittedFor
Action Function: This action can be used to identify a single user that the request was submitted for (or on behalf of). When set, the “Submitted For” user will be displayed and searchable in Request History.
Action Outputs: The SubmittedFor Activity returns the following:
Success – The designated User variable is set successfully
Failure – The filter condition for the User property does not return any matches
Action Properties:
Label
A label for the activity.
Properties
User
Defines the matching rules to select one user to store into the target variable.
Variable For User
This property is used to select the variable to be set by this action. The field will offer a drop-down menu of all existing user variables within the current workflow, as defined in the initial Start step.
Viewable
This property will control whether the Submitted For user will be displayed within Request History.
# Set Synchronous Output
Action Function: The Set Synchronous Output action allows a synchronous workflow to return a custom string result to the caller. This string can be a simple value such as “Yes” or “No”, or may contain rich data as JSON format, XML, or any other needed format.
Action Outputs: The Set Synchronous Output Activity returns no output values.
Action Properties:
Label
A label for the activity.
Properties
Output
Defines the result passed to the caller of the synchronous workflow.
# Start Child Workflow
Action Function: Starts a specific or all non-started bundled service workflows. All non-started bundled service workflows can be started at once or a specific bundled service can be started by specifying the Service ID. This activity is used within the workflow for the parent service of a bundled request. The parent service must have the request property “Auto Start Child Processes” as not set.
Action Outputs: The Submit Order Activity returns the following:
Not Found – Indicates the specified service request ID was not found
Successful – Returns Successful if the specified bundled requests can be started
Unsuccessful – Returns Unsuccessful if the specified bundled requests are unable to be started
Action Properties:
Label
A label for the activity.
Properties
Service ID - optional
The service ID of the bundled request to be started.
If this value is blank, then all non-started bundled requests will be started.
Start All Children
Specifies whether all remaining non-started bundled services should be started or only the specified bundled service.
Variable for Execution ID - Optional
Variable to place the service ID of the started child service. This is only used when a specific bundled service ID is started. This may be used to track the status of the called workflow.
# Submit Order
Action Function: The Submit Order activity allows an order to be submitted once a corresponding review workflow process has been completed.
NOTE: To use the Submit Order action, the Service.Catalog.Config.xml file in the “\Program Files\PMG Service Catalog\SPE” folder needs to be updated to include a valid Platform user account (user ID and password) with system admin rights. (Please contact PMG Support for more assistance.)
Action Outputs: The Submit Order activity returns the following output values:
Success – returned when the Order was successfully submitted for fulfillment
Failed – returned if the order was not successfully submitted for fulfillment
Action Properties:
Label
A label for the activity
Properties
BasketId
This property specifies the Basket ID to be submitted as a full order.
UserId (required)
This property is used to identify submitter for the order. This value will be reflected in the request order workflow as variable.SubmittedBy.
Leave this property blank to set as the current user (the user who initially submitted the order for review).
Variable for Order ID - Optional
A variable of type string in which to store the resulting Order ID.
# Update Parent Variables
Action Function: The Update Parent Variables Activity allows a workflow to update values of variables in another ascendant, “Parent” or higher, workflow.
Action Outputs: The Update Parent Variables Activity returns the following:
Updated – Indicates the specified variables were updated.
Not Updated – Returns if the specified variables could not be updated.
Action Properties:
Label
A label for the activity.
Properties
Parent Workflow Name
This property specifies a name of the parent workflow. The workflow name may be directly selected from the provided select box, or set dynamically with the Expression Builder.
List Parent Variables – Mandatory
The List Parent Variables property displays the parent variables and Xml Variables, allowing the user to update the value of each with the “Update Variable” select list. A value can be selected from the select list or a new value can be entered into the select list. A free-form value is selected after the user enters the value and presses the enter key, the tab key, or clicks on the entered text.
An “Update” checkbox is available on each row and indicates that the parent variable should be updated with the provided value. If the corresponding checkbox isn’t checked for that parent variable row, the update value is not saved. The checkbox must be checked for the row value to be set in the parent workflow.
A “Type” column is displayed for each row, indicating the type of parent variable. If a type label isn’t displayed, the parent variable is part of an Xml Document or Xml Iterator.
If the parent type is an array, it must be updated with an array variable from the current workflow. To specify the parent workflow variables to be set, select the property link for the 'List Parent Variables' property to open the property window.
In this window assign any needed values for any target variables available, and then click “Save” or “Save and Close” to close the property window.
# Update Status
Action Function: Changes the status of the workflow that may be displayed to the requester.
Action Outputs: The Update Status Activity returns no output values.
Action Properties:
Label
A label for the activity
Properties
Status
The status for the workflow
Percent Complete
The percentage complete for the workflow, a number from 0-100
Show in History View
This property will control whether the status message will be displayed within the request history screen.
# Update Status Bulk
Action Function: Changes the status of multiple workflow executions in a single order that may be displayed to the requester.
Action Outputs: The Update Status Bulk Activity returns no output values.
Action Properties:
Label
A label for the activity
Properties
Status
The status for the workflow
Percent Complete
The percentage complete for the workflow, a number from 0-100
Show in History View
This property will control whether the status message will be displayed within the request history screen.
Update All Workflows with same name from request
This property controls whether all executions of the workflow in an order will be updated.
Update Only Running
This property controls whether only running workflows will be updated.
# Data Workflows
Data workflow actions provide options to use workflow to return data. This data is then accessible through various methods when invoking Data Workflows, commonly as Workflow Functions, or throughout the PMG application.
# Set Table Output
Action Function: The Set Table Output action allows the workflow to convert a rich data document from either JSON or XML format into a “pivoted” tabular response as columns and rows.
Action Outputs: The Set Table Output Activity returns the following values:
Success – The action executed successfully
Error – An issue was encountered
Action Properties:
Label --
A label for the activity.
Properties
Data Variable
Specifies which workflow data variable contains the source data to be converted into a table.
Data Root
Specifies the parent node XPATH or JSON path
Columns
Defines the tabular format to be returned. The screen allows for any number of entries for each needed table “Column Name” and the “Path” for the source of the row for the data to return. For XML documents, the path is either simply the name of the node, or the XPATH to the data.
An example screen is below.
If the source document is JSON format, then similarly, the “Path” is the name of the JSON field, or is the JSON Path using dotted notation to the inner values, such as “spec.brand”. If the JSON property name has spaces the below example syntax may be used in the respective path property.
$.['I have spaces']
The below example illustrates converting a JArray within a JSON document into table output, where the JArray is nested. With the below sample,
{
"data": {
"people":
[
{
"email": "fredflint@quarry.com",
"name": "Fred Flint"
},
{
"email": "brabble@quartz.com",
"name": "Barney Rabble"
}
]
}
}
where we would like to return a table with the columns "Email" and "Name" from the Array data, we can use the Set Table Output action property "Data Root" as
data.people
which will navigate into the JSON to the inner array. Then, for each of the object property entries, we are interested to return the "email" and "name" values, so we can then set the "Columns" property for the action as below
which will result in the below output.
[
{
"Email": "fredflint@quarry.com",
"Name": "Fred Flint"
},
{
"Email": "brabble@quartz.com",
"Name": "Barney Rabble"
}
]
# Add Row to Table Output
Action Function: Add Row to Table Output is similar to Set Table Output, however instead of the single action processing the document at once, the action processes one row of data at a time, often used in conjunction with an iterator.
Action Outputs: The Add Row to Table Output activity returns the following values:
Success – The action executed successfully
Error – An issue was encountered
Action Properties:
Label
A label for the activity
Properties
Columns
Defines the tabular format to be returned. The screen allows for any number of entries for each needed table “Column Name” and the “Path” for the source of the row for the data to return. For XML documents, the path is either simply the name of the node, or the XPATH to the data.
An example screen is below.
If the source document is JSON format, then similarly, the “Path” is the name of the JSON field, or is the JSON Path using dotted notation to the inner values, such as “spec.brand”.
# Set String Output
Action Function: Set String Output allows a workflow to return a data output to the caller as a string.
Action Properties:
Label
A label for the activity
Properties
Output
Defines the output string to be returned. The string returned can be any valid data including simple values, strings, numbers, etc. or can be more complex, including JSON or XML structured data.
# Add Record
Action Function: The Add Record action adds a record to a record collection. New records are specified as a set of field values or document format. To add a record, use either the "Field Values" or "Document Value" property
Action Properties:
Label
A label for the activity
Records
A select list to choose the record collection name to add a record
Field Values
Presents a dialog to define one or more fields to be set in the added record. These fields will be interpreted to a document which is added to the record collection. The field select list presents available fields to set for the selected record collection. The Value field allows for fixed values, dynamic values as well as code using the Code icon to the right. The last option "Set as Null" is "False", or "True", and if "True" the field will be set with 'null' as its value.
The below example illustrates various options for new fields.
Document Value
As an alternative to Field Values, a document value may be provided instead, which should contain the JSON for the added record.
New Document ID
Provides an optional variable to store the newly created document ID.
Action Outputs
- Success – The action executed successfully
- Error – An issue was encountered
# Delete Record By ID
Action Function: This action removes a record from a record collection. The record to remove is specified by its internal ID.
Action Properties:
Label
A label for the activity
Record Collection
The record collection to remove the record
ID
The internal ID of the record instance to be deleted
Action Outputs
- Success – The action executed successfully
- Error – An issue was encountered
- Not Found – The record was not found
# Get Records
Action Function: The Get Records action retrieves records matching given conditions from a record collection. Matched records are returned as a JSON document.
Action Properties:
Label
A label for the activity
Query Configuration
The query configuration property displays a dialog to specify the query parameters for which records will be returned along with testing tools to validate the query. The dialog has the following values and sections.
Property | |
---|---|
Records | specifies which record collection will be searched |
Max result size | an optional maximum number of records to be returned |
Columns/Data | When the output mode is "Table Mapping", this property allows for the base nodes/fields of the record to be returned along with any additional optional transformed columns, using per column expressions, and "Virtual Columns". |
Output Format | Determines how the data will be returned. Choices are Table Mapping, where the data will be returned as a mapped table with columns, or Document Structure, which will return the native documents in the original JSON format. |
Conditions | allows for specifying conditions which will be used to filter and return records |
Sorting | allows for optional sorting of returned data |
Testing | allows for validating the query before running the workflow |
Output Variable
The variable to store the results. The return data format is controlled by the property "Output Mode" which can return JSON as objects or as arrays, and it is important to use a valid target type depending on the choice for output mode. In the case the results are a direct array type, the target must be a string or workflow object. To set results into a JSON Object variable type, the output mode should be "First Item as Object" or "Object with array property".
Include ID
When the Output Format is Document, this property determines if the internal ID of the records will be included in the results.
Output Mode
Options are as follows.
Option | |
---|---|
Array | the matched data will be returned as an Array |
First item as object | The first match will be returned as an object |
Object with array property | The matches will be returned as an object with the matches in an array property |
Action Outputs
- Success – The action executed successfully
- Error – An issue was encountered
# Update Records
Action Function: The Update Records action allows for modification to records in a collection.
Action Properties:
Label
A label for the activity
Records to Update
The query configuration property displays a dialog to specify the query parameters for which records will be returned along with testing tools to validate the query. The dialog has the following values and sections.
Property | |
---|---|
Records | specifies which record collection will be updated |
Max result size | an optional maximum number of records to be modified |
Conditions | allows for specifying conditions which will be used to match records to be modified |
Sorting | allows for optional sorting of matched data, when paired with max results, can be used to modify records in an order, individually. |
Testing | allows for validating the query before running the workflow |
Update Method
Record updates can be done by specifying particular fields, or by replacing the entire record document. Options for update method are below.
Fields - Individual fields can be set
Document - An entire document will be used as the update/replacement
Field Values
When the Update Method is "Fields", this property allows for specifying which fields of the matched records will be updated, and with which values.
This property presents a dialog where one or more fields can be added from the selected record collection and values can be specified for each.
Document
When the Update Method is "Document", this property provides for specifying the full replacement document for the matched records.
Update or Replace
Determines if the records will be updated or replaced
Affected Record Count
An optional variable to store the count of affected records.
No Match Output
Determines which output will be followed when there are no matches found. Options are "Success" and "No Match"
Action Outputs
Success – The action executed successfully
Error – An issue was encountered
No Match - when "No Match Output" is set to "No Match" and no records were matched, this path will be followed
# Generic Table
Action Function: The Generic Table action allows for the creation of a SQL table, a table type, a stored procedure, and inserting/updating rows from a JSON array object.
Action Properties:
Label
A label for the action
Input JSON Array
The input JSON array (or a variable with the input JSON array).
Database/Type
A property to specify the database to use or a database type if using the Connection String/Data Source property
Connection String/Data Source
The connection string or a registered data source name if one of those corresponding options was selected in the Database/Type property.
DB Timeout
The database timeout for the database activities this action performs.
Table Name
The name of the table to create in the specified database. This name will also be used for the table type and stored procedure. The table type will be named {tablename}TableType and the stored procedure will be named proc_BulkImport{tablename} with the {tablename} placeholder replaced with the name of the table.
Mapping Document
A JSON Object which describes how to create the database table and how to parse the input JSON array.
Example:
{ "columns": [ { "columnName": "employeeNumber", "sqlType": "int", "dotNetType": "System.Int32", "allowNull": false, "isPrimaryKey": true, "path": "$.employeeNumber" }, { "columnName": "firstName", "sqlType": "nvarchar(500)", "dotNetType": "System.String", "allowNull": false, "isPrimaryKey": false, "path": "$.firstName" }, { "columnName": "lastName", "sqlType": "nvarchar(500)", "dotNetType": "System.String", "allowNull": false, "isPrimaryKey": false, "path": "$.lastName" }, { "columnName": "email", "sqlType": "nvarchar(500)", "dotNetType": "System.String", "allowNull": false, "isPrimaryKey": false, "path": "$.email" }, { "columnName": "department", "sqlType": "nvarchar(200)", "dotNetType": "System.String", "allowNull": true, "isPrimaryKey": false, "path": "$.department" }, { "columnName": "hireDate", "sqlType": "datetime", "dotNetType": "System.DateTime", "allowNull": true, "isPrimaryKey": false, "path": "$.hireDate" } ] }
Each JObject in the columns JSON array describes a column in the database.
columnName – The name of the column
sqlType – The type of the column
dotNetType – The type of the column in C# code. Current supported options: System.String, System.DateTime, System.Long, System.Boolean, System.Int64, System.Int32, and System.Char
allowNull – true or false for whether or not to allow null values in the column
isPrimaryKey – true or false for whether or not the column is the primary key. Only one column can have true and one column must have true
path – The JSON path to the value in the input JSON array. This value will be put in the column. The array is looped through in code, so the JSON path is relative to the looped object
Error Message Variable
A variable in which to hold the error message if the action doesn't execute successfully.
Action Outputs
Success – The action executed successfully
Failure – An issue was encountered